package com.le.tester.common.enums;

/**
 * 描述：redis Key,不再后面加上：而是如果有不同的字段。使用::进行拼接
 */
public enum RedisKey {

    //手机验证码hash存储
    SMS_RECORD("SMS_RECORD", "存储短信hash,count,lastTime"),

    //手机验证码存储key
    SMS_VALIDATE_CODE("SMS_VALIDATE_CODE", "存储短信验证码"),

    //次数的key
    SMS_COUNT("SMS_COUNT", "短信次数"),

    //发送的最后时间
    SMS_LAST_TIME("SMS_LAST_TIME", "短信发送的最后时间"),

    //订单的key
    ORDERS("ORDERS", "存入redis的订单key"),

    //实时排行榜
    SCORE_RANK("SCORE_RANK", "实时排行"),

    //全部的产品信息key
    PRODUCT_ALL("PRODUCT_ALL", "全部产品信息"),

    //用户点赞数据的key
    MAP_KEY_USER_LIKED("MAP_USER_LIKED", "用户点赞数据的key"),

    //用户被点赞数量的key
    MAP_USER_LIKED_COUNT("MAP_USER_LIKED_COUNT", "用户被点赞数量的key"),

    //秒杀的减库存key
    DEC_STORE_LOCK("DEC_STORE_LOCK", "秒杀的减库存key");

    private String code;
    private String desc;

    RedisKey(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "RedisKey{" +
                "code='" + code + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
